From f8cff8c0b7a6c849ebbd6da6f89c2f33360a9328 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 23 May 2005 18:17:51 +0000 Subject: [PATCH] bitkeeper revision 1.1515 (42921e4fRcf8j8oxgO4SHlBhn0dSuw) Better handling of NULL callback pointers -- synchronously crash the offending domain. This gets us some nice debug output for domain0. Signed-off-by: Keir Fraser --- xen/arch/x86/traps.c | 18 ------------------ xen/arch/x86/x86_32/entry.S | 2 ++ xen/arch/x86/x86_64/entry.S | 2 ++ 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index da39f5c966..fc2ee40d7b 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -245,12 +245,6 @@ static inline int do_trap(int trapnr, char *str, if ( !GUEST_MODE(regs) ) goto xen_fault; -#ifndef NDEBUG - if ( (ed->arch.guest_context.trap_ctxt[trapnr].address == 0) && - (ed->domain->domain_id == 0) ) - goto xen_fault; -#endif - ti = ¤t->arch.guest_context.trap_ctxt[trapnr]; tb->flags = TBF_EXCEPTION; tb->cs = ti->cs; @@ -450,12 +444,6 @@ asmlinkage int do_page_fault(struct cpu_user_regs *regs) if ( !GUEST_MODE(regs) ) goto xen_fault; -#ifndef NDEBUG - if ( (ed->arch.guest_context.trap_ctxt[TRAP_page_fault].address == 0) && - (d->domain_id == 0) ) - goto xen_fault; -#endif - propagate_page_fault(addr, regs->error_code); return 0; @@ -932,12 +920,6 @@ asmlinkage int do_general_protection(struct cpu_user_regs *regs) return 0; #endif -#ifndef NDEBUG - if ( (ed->arch.guest_context.trap_ctxt[TRAP_gp_fault].address == 0) && - (ed->domain->domain_id == 0) ) - goto gp_in_kernel; -#endif - /* Pass on GPF as is. */ ti = ¤t->arch.guest_context.trap_ctxt[TRAP_gp_fault]; tb->flags = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE; diff --git a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S index 1f6f2ff1e8..279925a1ce 100644 --- a/xen/arch/x86/x86_32/entry.S +++ b/xen/arch/x86/x86_32/entry.S @@ -331,6 +331,8 @@ FLT13: movl UREGS_ss+4(%esp),%gs movb TRAPBOUNCE_flags(%edx),%cl subl $12,%esi movl UREGS_eip+4(%esp),%eax + test %eax,%eax + jz domain_crash_synchronous FLT14: movl %eax,%gs:(%esi) movl EDOMAIN_vcpu_info(%ebx),%eax pushl VCPUINFO_upcall_mask(%eax) diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index e10562dc22..ed2e41dc6f 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -320,6 +320,8 @@ FLT4: movq %rax,16(%rsi) # RFLAGS movw UREGS_cs+8(%rsp),%ax # Bits 0-15: CS FLT5: movq %rax,8(%rsi) # CS/saved_upcall_mask movq UREGS_rip+8(%rsp),%rax + testq %rax,%rax + jz domain_crash_synchronous FLT6: movq %rax,(%rsi) # RIP testb $TBF_EXCEPTION_ERRCODE,%cl jz 1f -- 2.30.2